package lock;/** * @Date: 2020/6/28 16:08 * @Description: */public   class    SynchronizedDemo {    public static void main(String[] args) {    }    //当修饰方法的时候，是插入flag标志 ACC_SYNCHRONIZED    public   synchronized void testSync(){        //当synchronized修饰代码块，会给在指令中差如monitorenter和monitorexit        //synchronized (this){            System.out.println("测试");        //}    }}